Embodiments of the present inventive concepts relate to a method and apparatus for encoding and decoding an image.
When an image is encoded in an image compression mode, for example, moving picture experts group phase 1 (MPEG-1), moving picture experts group phase 2 (MPEG-2), or moving picture experts group phase 4 (MPEG-4 H.264/MPEG-4) advanced video coding (AVC), a picture is divided into a plurality of macroblocks. Thereafter, each of the macroblocks is predictively encoded using inter prediction or intra prediction. Specifically, a prediction block is generated for a current block to be encoded using inter prediction or intra prediction and only a residual block obtained by subtracting the prediction block from the current block is encoded and transmitted. Instead of encoding a pixel value of each pixel included in the current block, before encoding is performed, a prediction value for each pixel included in the prediction block is subtracted from the pixel value of each pixel included in the current block to generate a residual block, so that compression efficiency is increased in encoding.
In encoding the residual block, transforming the residual block into a frequency domain, quantization, and entropy encoding are sequentially performed. The transforming of the residual block into a frequency domain may be skipped based on a high efficiency video coding (HEVC) standard. When a reference software is used to determine whether to skip transforming the residual block into a frequency domain or to transform the residual block into a frequency domain, a compression cost is calculated in rate-distortion optimization (RDO)-on mode. In this case, complex reconstruction needs to be fully performed.